January 26, 2025
+ 12

We recommend using SDKMAN to install the JDK, and Mandrel (the Quarkus-recommended version of GraalVM).

console
sdk install java 24.0.2.r22-mandrel sdk use java 24.0.2.r22-mandrel

Creating a Quarkus App

It is recommended to generate a starter app using the Quarkus Code Starter. If you already have a Quarkus app on hand, install with Maven or Gradle as follows:

Add this to your pom.xml:

xml
<dependency> <groupId>io.quarkiverse.couchbase</groupId> <artifactId>quarkus-couchbase</artifactId> <version>1.0.0</version> </dependency>

Configuring Couchbase

Configure the connection in your application.properties file, typically located in src/main/resources:

properties
quarkus.couchbase.connection-string=localhost quarkus.couchbase.username=username quarkus.couchbase.password=password

For additional configuration options, refer to the Quarkus Configuration Guide or API Reference.

Using the Extension

The extension produces an Application-scoped Cluster bean that can be injected using the jakarta annotation @Inject:

java
public class QuarkusExample { @Inject Cluster cluster; }

From there, you can use the Cluster object like you normally would with the Java SDK. Refer to the Quarkus Guide for an example using quarkus-rest to create HTTP endpoints.